# -*- coding: utf-8 -*-

"""
Created on Fri Jun  8 18:43:24 2018

@author: Administrator
"""
#%%

from nilearn.image import  load_img



#%%

class Voxel_percent(object):
  #计算number of mask1 占 number of mask2的百分比
  def __init__(self,mask1_filepath,mask2_filepath):
    mask1_array = load_img(mask1_filepath).get_data()
    mask2_array = load_img(mask2_filepath).get_data()
    
    print('number of voxel of mask1:',mask1_array.sum())
    print('number of voxel of mask2:',mask2_array.sum())
    print('percent:', mask1_array.sum()/mask2_array.sum())
    self.percent =mask1_array.sum()/mask2_array.sum()
    
#%%
    

